<?php
require_once '../sub/init.php';
define('ZEAI2',dirname(__FILE__).DIRECTORY_SEPARATOR);
require_once 'chkUadm.php';
require_once ZEAI.'cache/config_shop.php';
require_once ZEAI.'cache/config_reg.php';
$left_top_menu = dataIO($_ADM['adm_left_top_menu'.$session_uid],'out');
$left_top_menu = explode(',',$left_top_menu );?>
<div class="lmainbox">
<div class="logo"><?php echo $_ADM['admSiteName'];?><font><?php echo $_ZEAI['ver'];?></font></div>
<div class="L on">
    <dt><i class="ico">&#xe65e;</i>工作台</dt>
    <dd>
        <a url="welcome.php" class="ed">● 待办首页</a>
        <div id="diydd"><?php
        if (count($left_top_menu) >= 1 && is_array($left_top_menu) && !empty($_ADM['adm_left_top_menu'.$session_uid])){
            foreach ($left_top_menu as $V) {
                $VARR = explode('|WWW.A9A.CN|',$V);$url=$VARR[0];$title=$VARR[1];
                echo '<a url="'.$url.'">'.$title.'</a>';
            }
        }?></div>
        <?php if(ADMQX('adm_left_top_menu')){?><a url="left_diy.php"><i class="ico">&#xe6a7;</i> 自定义<font class="newdian"></font></a><?php }?>
    </dd>
</div>
<div class="L">
    <dt><i class="ico">&#xe617;</i>用户管理</dt>
    <dd>
        <?php if(ADMQX('u')){?><a url="u.php">● 用户列表</a><?php }?>
        <?php if(ADMQX('u_select')){?><a url="u_select.php">● 用户查询</a><?php }?>
        <?php if(ADMQX('u_add')){?><a url="u_add.php">● 用户录入</a><?php }?>
        <?php if(ADMQX('urole')){?><a url="urole.php">● 套餐权限<font class="newdian"></font></a><?php }?>
        <?php if(ADMQX('u_jb_list')){?><a url="u_jb_list.php">● 资料审核</a><?php }?>
        <?php if(ADMQX('photo_m')){?><a url="photo_m.php">● 头像置顶</a><?php }?>
        <?php if(ADMQX('photo')){?><a url="photo.php">● 用户相册</a><?php }?>
        <?php if(ADMQX('cert')){?><a url="cert.php">● 认证管理<font class="newdian"></font></a><?php }?>
        <?php if(ADMQX('tip_list') || ADMQX('chat_list') || ADMQX('view_list') || ADMQX('gz_list') || ADMQX('hh_list') || ADMQX('u_bbs')){?><a url="u_endtime.php">● 用户轨迹<font class="newdian"></font></a><?php }?>
        <?php if(ADMQX('sign')){?><a url="sign.php">● 用户承诺书<font class="newdian"></font></a><?php }?>
        <a url="excel_out.php">● 资料导出</a>
    </dd>
</div>
<div class="clear"></div>
<div class="L">
    <dt><i class="ico">&#xe621;</i>内容管理</dt>
    <dd>
    	<?php if(ADMQX('about')){?>
            <a url="about.php?t=us">● 网站简介</a>
            <a url="about.php?t=contact">● 联系我们</a>
            <a url="about.php?t=declara">● 隐私条款</a>
        <?php }?>
        <?php if(ADMQX('news_gg')){?><a url="news.php?ifgg=1">● 网站公告</a><?php }?>
        <hr />
        <?php if(ADMQX('qun')){?><a url="qun.php">● 单身群<font class="newdian"></font></a><?php }?>
        <?php if(ADMQX('news') || ADMQX('news_kind')){?><a url="news.php">● 文章管理</a><?php }?>
        <?php if(ADMQX('party')){?><a url="party.php">● 相亲活动</a></a><?php }?>
        <?php if(ADMQX('dating')){?><a url="dating.php">● 约会管理</a><?php }?>
        <?php if(ADMQX('video')){?><a url="video.php">● 视频管理</a><?php }?>
        <?php if(ADMQX('trend')){?><a url="trend.php">● 动态管理</a><?php }?>
        <?php if(ADMQX('gift')){?><a url="gift.php">● 礼物管理</a><?php }?>
        <?php if(ADMQX('hongbao')){?><a url="hongbao.php" style="display:none">● 红包管理</a><?php }?>
        <?php if(ADMQX('315')){?><a url="315.php">● 举报管理</a><?php }?>
        <?php if(ADMQX('315')){?><a url="udel.php">● 注销管理</a><?php }?>
    </dd>
</div>
<div class="L">
    <dt><i class="ico">&#xe6fd;</i>运营管理</dt>
    <dd>
        <?php if(ADMQX('bounce_vip') || ADMQX('bounce_index')){?><a url="bounce.php?t=indexgg">● 反弹海报</a><?php }?>
        <?php if(ADMQX('adv')){?><a url="var.php?t=6">● 广告管理</a><?php }?>
        <?php if(ADMQX('form')){?><a url="form.php">● 表单采集</a><?php }?>
        <?php if(ADMQX('huxuan')){?><a url="huxuan.php">● 互选相亲</a><?php }?>
        <?php if(ADMQX('manghe')){?><a url="manghe.php">● 脱单盲盒<font class="newdian"></font></a><?php }?>
        <?php if(ADMQX('lovetest')){?><a url="lovetest_bank.php">● 情感测试</a><?php }?>
        <?php if(ADMQX('u_top')){?><a url="u_top.php">● 付费置顶</a><?php }?>
        <?php if(ADMQX('switchs_loveb')){?><a url="switchs.php?t=2">● <?php echo $_ZEAI['loveB'];?>配置</a><?php }?>
        <?php if(ADMQX('switchs_shkg')){?><a url="switchs.php?t=3">● 功能开关</a><?php }?>
        <?php if(ADMQX('hi_set')){?><a url="hi_set.php">● 打招呼设置</a><?php }?>
        <?php if(ADMQX('wx_gzh_push')){?><a url="wx_gzh.php?t=1">● 公众号推送</a><?php }?>
        <?php if(ADMQX('robot')){?><a url="robot.php">● AI机器人</a><?php }?>
    </dd>
</div>
<div class="L on">
    <dt><i class="ico">&#xe903;</i>数据管理</dt>
    <dd>
        <?php if(ADMQX('pay_qd')){?><a url="pay.php">● 支付清单</a><?php }?>
        <?php if(ADMQX('loveb_qd')){?><a url="loveb.php">● <?php echo $_ZEAI['loveB'];?>清单</a><?php }?>
        <?php if(ADMQX('money_qd')){?><a url="money.php">● 余额清单</a><?php }?>
        <?php if(ADMQX('log') || ADMQX('logdel')){?><a url="log.php">● 操作日志</a><?php }?>
        <?php if(ADMQX('analyse_month')){?><a url="analyse_month.php?t=1">● 数据月报</a><?php }?>
        <?php if(ADMQX('analyse_u')){?><a url="analyse_u.php?t=1">● 用户分析</a><?php }?>
        <?php if(ADMQX('analyse_u')){?><a url="analyse_u.php?t=2">● 资料分析</a><?php }?>
    </dd>
</div>
<div class="L">
    <dt><i class="ico">&#xe902;</i>系统配置</dt>
    <dd>
        <?php if(ADMQX('var_jb')){?><a url="var.php">● 站点设置</a><?php }?>
        <?php if(ADMQX('nav')){?><a url="var.php?t=nav">● 模块导航</a><?php }?>
        <?php if(ADMQX('switchs_reg')){?><a url="switchs.php?t=1">● 注册设置</a><?php }?>
        <?php if(ADMQX('udata')){?><a url="udata3.php">● 资料属性</a><?php }?>
        <?php if(ADMQX('area')){?><a url="area1.php">● 地区管理</a><?php }?>
        <?php if(ADMQX('var_gzh')){?><a url="var.php?t=2">● 公众号配置</a><?php }?>
        <?php if(ADMQX('var_payset')){?><a url="var.php?t=5">● 支付配置</a><?php }?>
        <?php if(ADMQX('var_smsemail')){?><a url="var.php?t=4">● 短信配置</a><?php }?>
        <?php if(ADMQX('var_rz')){?><a url="var.php?t=rz">● 认证配置</a><?php }?>
        <?php if(ADMQX('var_qqloginemail')){?><a url="var.php?t=3">● 帐号互联</a><?php }?>
        <?php if(ADMQX('adm_localhost_auth')){?><a url="localhost_auth.php">● 本机授权</a><?php }?>
        <?php if(ADMQX('badkeyword')){?><a url="badkeyword.php">● 敏感词过滤</a><?php }?>
        <?php if(ADMQX('role')){?><a url="adminuser.php">● 后台管理员</a><?php }?>
        <?php if(ADMQX('databak')){?><a url="backup.php">● 数据备份</a><?php }?>
    </dd>
</div>
<div class="blank"></div>
</div>
<script src="js/left.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php
/********坠海*******/
if($_CRM['sea_hn_day']>0){// && $session_uid==25
	$seatime1 = $_CRM['sea_hn_day']*86400;
	$SQL  = " (flag=1 OR flag=-2) AND kind<>4 AND admid>0 AND hnid>0 AND crm_ugrade=0 AND (".ADDTIME." - seatime) > $seatime1";
	$rt2=$db->query("SELECT id,nickname,truename,hnid FROM ".__TBL_USER__." WHERE ".$SQL);
	$total2 = $db->num_rows($rt2);
	if ($total2 > 0) {
		for($i2=1;$i2<=$total2;$i2++) {
			$rows2 = $db->fetch_array($rt2,'name');
			if(!$rows2) break;
			$uid      = $rows2['id'];
			$nickname = trimhtml(dataIO($rows2['nickname'],'out'));
			$truename = trimhtml(dataIO($rows2['truename'],'out'));
			$truename = (!empty($truename))?'（姓名:'.$truename.'）':'';
			$hnid     = intval($rows2['hnid']);
			//
			$row = $db->ROW(__TBL_ADMIN__,"username,agentid,agenttitle","id=".$hnid,"name");
			if($row){
				$session_uid        = $hnid;
				$session_uname      = trimhtml(dataIO($row['username'],'out'));
				$session_kind       = 'crm';
				$session_agentid    = $row['agentid'];
				$session_agenttitle = $row['agenttitle'];
				$db->query("UPDATE ".__TBL_USER__." SET hnid=0,hnname='',hntime=0 WHERE id=".$uid);
				AddLog('【售前'.$_CRM['sea_hn_day'].'天自动坠海】->客户【'.$nickname.$truename.'（uid:'.$uid.'）】');
			}
		}
	}
}
if($_CRM['sea_hn2_day']>0){//
	$seatime1 = $_CRM['sea_hn2_day']*86400;
	$SQL  = " (flag=1 OR flag=-2) AND kind<>4 AND admid>0 AND hnid2>0 AND crm_ugrade>0 AND crm_flag<>3 AND (".ADDTIME." - seatime) > $seatime1 ";
	$rt2=$db->query("SELECT id,nickname,truename,hnid2 FROM ".__TBL_USER__." WHERE ".$SQL);
	$total2 = $db->num_rows($rt2);
	if ($total2 > 0) {
		for($i2=1;$i2<=$total2;$i2++) {
			$rows2 = $db->fetch_array($rt2,'name');
			if(!$rows2) break;
			$uid      = $rows2['id'];
			$nickname = trimhtml(dataIO($rows2['nickname'],'out'));
			$truename = trimhtml(dataIO($rows2['truename'],'out'));
			$truename = (!empty($truename))?'（姓名:'.$truename.'）':'';
			$hnid2     = intval($rows2['hnid2']);
			//
			$row = $db->ROW(__TBL_ADMIN__,"username,agentid,agenttitle","id=".$hnid2,"name");
			$session_uid        = $hnid2;
			$session_uname      = trimhtml(dataIO($row['username'],'out'));
			$session_kind       = 'crm';
			$session_agentid    = $row['agentid'];
			$session_agenttitle = $row['agenttitle'];
			//
			$db->query("UPDATE ".__TBL_USER__." SET hnid2=0,hnname2='',hntime2=0 WHERE id=".$uid);
			AddLog('【售后'.$_CRM['sea_hn2_day'].'天自动坠海】->客户【'.$nickname.$truename.'（uid:'.$uid.'）】');
		}
	}
}
?>
